import React from 'react';
import { Card, Button, Checkbox, Form, Input } from 'antd';
export default function Login(props) {
  const onFinish = values => {
    localStorage.setItem('token', values.username)
    props.history.push('/admin/home')
  };
  return <div style={{ backgroundImage: "url(/img/1.jpg)", backgroundRepeat: "no-repeat", height: "100vh", backgroundSize: "cover", display: "flex", justifyContent: "center", alignItems: "center" }}>
    <Card title="Default size card" style={{ width: 450, textAlign: "center" }}>
      <Form
        onFinish={onFinish}
      >
        <Form.Item
          label="账号"
          name="username"
          rules={[{ required: true, message: 'Please input your username!' }]}
        >
          <Input />
        </Form.Item>

        <Form.Item
          label="密码"
          name="password"
          rules={[{ required: true, message: 'Please input your password!' }]}
        >
          <Input.Password />
        </Form.Item>
        <Form.Item label={null}>
          <Button type="primary" htmlType="submit">
            登录
          </Button>
        </Form.Item>
      </Form>
    </Card>
  </div>
}

